package com.company.project.jersey.config;

import org.glassfish.jersey.servlet.ServletContainer;
import org.glassfish.jersey.servlet.ServletProperties;
import org.springframework.boot.web.servlet.ServletRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * Author: songzhonglin
 * Date: 2018/4/12
 * Time: 8:47
 * Description: JerseyConfig
 **/
@Configuration
public class JerseyConfig {

    @Bean
    public ServletRegistrationBean jerseyServlet(){
        ServletRegistrationBean registration = new ServletRegistrationBean(new ServletContainer(), "/jk/*");
        registration.addInitParameter(ServletProperties.JAXRS_APPLICATION_CLASS, JerseyApplication.class.getName());
        return registration;
    }
}
